package Graph;

import GraphCore.EdgeInterface;

/**
 * @author rodacki, Tiago,Ruan
 * Objeto que representa a Aresta do Grafo.
 */
public class Edge implements EdgeInterface {
    private Vertex vi;
    private Vertex vj;
    private int cost;
    /**
     * 
     * Construtor 
     */
    public Edge(Vertex vi, Vertex vj, int cost){
        this.vi = vi;
        this.vj = vj;
        this.cost = cost;
    }

    /*
     * get Vi
     */
    @Override
    public Vertex getVi() {
        return vi;
    }
    
    /*
     * get Vj
     */
    @Override
    public Vertex getVj() {
        return vj;
    }

    /*
     * toString da Aresta
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Edge{ vi=");
        sb.append(vi);
        sb.append(", vj=");
        sb.append(vj);
        sb.append("}");
        return sb.toString();
    }

    public int getCost() {
        return cost;
    }

    public void setCost(int cost) {
        this.cost = cost;
    }
}